package day12.Ti.ZH1;


import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Text {
    public static void main(String[] args) throws IOException {
        List<Student> stuList = new ArrayList<>();
        stuList.add(new Student("张三","男",20));
        stuList.add(new Student("李四","女",19));
        stuList.add(new Student("王五","男",21));
        stuList.add(new Student("赵六","女",18));
        BufferedWriter bw=new BufferedWriter(new FileWriter("jinjie\\stus.txt"));
        for (Student s : stuList) {
           bw.write(s+"");
           bw.newLine();
           bw.flush();
        }
        bw.close();
    }
}
